file(GLOB cc_sources *.cc)
file(GLOB cc_algorithm_sources algorithm/*.cc)
file(GLOB cc_vertex_sources vertex/*.cc)
file(GLOB cc_font_sources font/*.cc)

add_library(buolaimage SHARED ${cc_sources} ${cc_algorithm_sources} ${cc_font_sources} ${cc_vertex_sources})

find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(TIFF REQUIRED)
find_package(Freetype REQUIRED)
find_package(Fontconfig REQUIRED)

buola_find_libraries(LIB_HARFBUZZ harfbuzz harfbuzz-icu)

include_directories(${FREETYPE_INCLUDE_DIR_freetype2}
                    ${FONTCONFIG_INCLUDE_DIR}
                    ${TIFF_INCLUDE_DIR})

target_link_libraries(buolaimage buolacore ${JPEG_LIBRARIES} ${PNG_LIBRARIES}
                     ${LIB_HARFBUZZ} ${FONTCONFIG_LIBRARIES} ${FREETYPE_LIBRARIES} ${TIFF_LIBRARIES})

set_target_properties(buolaimage PROPERTIES VERSION ${GENERIC_LIB_VERSION}
                                        SOVERSION ${GENERIC_LIB_SOVERSION})
install(TARGETS buolaimage DESTINATION ${LIB_INSTALL_DIR})
